import Vue from 'vue'
import VueRouter from 'vue-router'
import Admin from '../views/AdminLogin.vue'

Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    name: 'Admin',
    component: Admin
  },
  {
    path: '/home',
    name: 'Home',
    component: () => import('../views/Home.vue'),
    children:[{
      path: '/detail',
      name: 'Detail',
      component: function () {
        return import( /* webpackChunkName: "about" */ '../views/menu/CakeDetail.vue')
      },
     },
     {
      path: '/addCake',
      name: 'Add',
      component: function () {
        return import( /* webpackChunkName: "about" */ '../views/menu/AddCake.vue')
      },
     },
    ],
  },
]

const router = new VueRouter({
  mode: 'history',
  base: process.env.BASE_URL,
  routes
})

export default router
